from time import sleep

from selenium.webdriver.common.by import By

from base.base import Base


class Page(Base):
    sousuo = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout[1]/android.widget.RelativeLayout/android.widget.FrameLayout[2]/android.widget.RelativeLayout/android.widget.ViewSwitcher/android.widget.RelativeLayout')
    shuru1=(By.ID,'com.achievo.vipshop:id/search_text_view')
    shuru = (By.XPATH, 'android.widget.EditText[@Text="巴拉巴拉"]')
    anniu = (By.ID, 'com.achievo.vipshop:id/tv_search')
    dy = (By.ID, 'com.achievo.vipshop:id/text_sales_volume')
    dy1 = (By.ID, 'com.achievo.vipshop:id/tips')
    anniu1='new UiSelector().Text("搜索")'
    anniu2='new.UiSelector().resourceId("com.achievo.vipshop:id/tv_search")'
    # 未找到相关商品，为您推荐口碑优质好物
    # 风扇电机佛危废间问哦机构
    def sousuoyewu(self,filename):
        self.loc_ele(self.sousuo).click()
        sleep(3)
        self.loc_ele(self.shuru1).send_keys(filename)
        sleep(3)
        self.loc_ele(self.anniu).click()
        sleep(3)